//
//  WMPhoto.h
//  WeightMaster
//
//  Created by sungeo on 15/8/29.
//  Copyright (c) 2015年 buddysoft. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CloudKit/CloudKit.h>
#import "BaseModel.h"

extern NSString * const WMPhotoRecord;

@interface WMPhoto : BaseModel

//@property (nonatomic, strong) UIImage * image;

@property (nonatomic, strong) NSString * UUID;

@property (nonatomic, strong) NSNumber * isUploaded;        // 是否已上传到 Cloud
@property (nonatomic, strong) NSNumber * isDownloaded;      // 是否从 Cloud 下载到本地

@property (nonatomic, strong) NSNumber * needDelete;        // 是否需要从 Cloud 删除


- (CKRecord *)iCloudRecord;

- (BOOL)deleteLocalPhoto;

- (void)setImage:(UIImage *)image;

+ (NSURL *)localImageURLForUUID:(NSString *)UUID;

- (UIImage *)updateImageWithCKRecord:(CKRecord *)record;

@end
